<template>
  <div class="goods-item" @click="$router.push({path:'/goods/detail',query:{goodsId:goods.goods_id}})">
    <div class="left">
      <img :src="goods.goods_image" alt=""/>
    </div>
    <div class="right">
      <p class="goods-title ellipsis-2">{{ goods.goods_name }}</p>
      <p class="sold"> 已售{{ goods.goods_sales }}件</p>
      <div class="price">
        <p class="new-price">￥{{ goods.goods_price_min ?? goods.goods_price }}</p>
        <p class="origin-price">￥{{ goods.line_price_min ?? goods.line_price }}</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    goods: {}
  }

}
</script>

<style lang="less" scoped>
.goods-item {
  display: flex;
  height: 148px;
  gap: 5px;
  background-color: #fff;

  .left {
    flex: 1;

    img {
      width: 100%;
      height: 100%;
    }
  }

  .right {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;

    p {
      margin: 0;
    }

    .goods-title {
      word-break: break-all;

    }

    .goods-title {
      color: #484848;
      font-size: 19px;
    }

    .sold {
      font-size: 12px;
      color: #b3b3b3;
    }

    .price {
      display: flex;
      justify-content: flex-start;
      align-items: center;
      gap: 5px;

      .new-price {
        color: #f03c3c;
        font-size: 22px;
      }

      .origin-price {
        color: #999;
        font-size: 17px;
        text-decoration: line-through #999;

      }
    }
  }
}
</style>
